drivers: usb: udc: dwc3: initial implementation#84544
Conversation
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
|
Once USB3 support lands (I anticipate after If anybody need this before that happen, do feel free to ping me about it. |
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
|
can this (and the dependency) be reopened? i feel like this should be a welcome addition |
|
@natto1784 yes absolutely. However it might need a platform with which this can be tested with, otherwise it is dead code. Do you know of any available hardware that can be picked for testing it? |
|
It seems like you are working on Here is the current state of this driver:
I am |
|
Hi, @josuah, after some efforts with minimal changes/fixes to your driver (+ a small glue driver of our own), I have managed to get the CDC ACM sample working on AM62x SK platform which is already in the Zephyr tree, so perhaps we can get this PR re-opened, or is there some other approach to compiling patches in one patchset that you would prefer? I am open to talking on discord as well if that is what you prefer, my nickname is @ amneesh on the Zephyr discord. In the meantime can you tell me the rationale behind adding the Note that I got it working with the next stack and have not tested with the legacy one, but it should work regardless. |
|
Thank you for trying and making it so far! It looks like there are two parallel efforts to get DWC3 working:
Luckily, both platforms use the same basis for the driver, so the implementation should be relatively similar.
If it was, I would need to be the one pushing the commits, so best if you open a new one.
The legacy stack uses different driver APIs, so it will not work with the legacy stack, but this is not a bad thing as it is expected to be deprecated relatively soon. |
|
It is best to ignore it. |
|
I will ping you in the "DWC3 Upstreaming" thread... |
Let's keep it open until there is a new one. Alternatively, you can allow to push to this branch. |
| @@ -0,0 +1,1593 @@ | |||
| /* | |||
| * SPDX-License-Identifier: MIT | |||
There was a problem hiding this comment.
It used to be the fallback license that tinyVision.ai used for everything, I can request it to be changed.
|
I understand that. I meant to ask whether it would be alright to get rid of it as it's vendor specific code. It would be alright to add it as some sort of quirk I think. Let's discuss more on discord.
…On 12 February 2026 9:33:27 pm IST, josuah ***@***.***> wrote:
josuah left a comment (zephyrproject-rtos/zephyr#84544)
`DT_INST_REG_ADDR_BY_NAME()` "REG" here stands for "Register", as in `reg = <0x.....>;`.
`ev_*` is what LiteX uses, an FPGA-based SoC architecture, so not relevant to DWC3 driver.
It is best to ignore it.
--
Reply to this email directly or view it on GitHub:
#84544 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
Yes, totally, it better not be there and was planned to be removed for something more generic. |
eb1629d to
3ee1194
Compare
|
@josuah Do you want to have USB3 support in the stack, or will you limit this driver to support high-speed only and add USB3 support in the stack later? |
|
@jfischer-no I was thinking of keeping it USB2, and have a separate USB3 PR based on top of this DWC3 PR. This way all the noise about DWC3 hardware can be kept away from USB3 protocol discussions. If anything else is preferred let me know! |
|
I for one, do not mind HS-only DWC3 driver first before adding SS support. Also I think we can open this for review soon, would be great if we could get this merged for 4.5. |
|
Hi, has there been some progress on using |
81a1786 to
1dadb54
Compare
|
Force-push: refactor according to #103493 Tested on a CrossLinkU-NX33 FPGA, but no result so far (needs vendor quirks for it). |
| * ACK/NAK the first packets from the host with the new address, otherwise the host | ||
| * issue a reset | ||
| */ | ||
| if (cfg->setup_pkt->bmRequestType == 0x00 && cfg->setup_pkt->bRequest == 0x05) { |
There was a problem hiding this comment.
| if (cfg->setup_pkt->bmRequestType == 0x00 && cfg->setup_pkt->bRequest == 0x05) { | |
| if (cfg->setup_pkt->bmRequestType == USB_REQTYPE_TYPE_STANDARD && cfg->setup_pkt->bRequest == USB_SREQ_SET_ADDRESS) { |
There was a problem hiding this comment.
Thank you. This is still WIP but that is one thing less to lookup :)
| udc_dwc3_do_set_address(dev, cfg->setup_pkt->wValue); | ||
| } | ||
|
|
||
| udc_setup_received(dev, cfg->setup_pkt); |
There was a problem hiding this comment.
Note: You can also directly use the programmed setup buffer in your EP0 queue by passing NULL here, I wonder which one is a better approach
There was a problem hiding this comment.
I realized that the stack would submit the setup buffer, so yes this can be simplified by one less special case.
Maybe drivers that use a local buffer for setup are those which constantly need a buffer ready for setup.
There was a problem hiding this comment.
Yes, a lot better thank you.
| /* Latency optimization: set the address immediately to be able to be able to | ||
| * ACK/NAK the first packets from the host with the new address, otherwise the host | ||
| * issue a reset |
There was a problem hiding this comment.
Set addr_before_status controller controller capability.
There was a problem hiding this comment.
This was missing thank you.
ec56b9f to
18f7fba
Compare
|
Force-push: fix all runtime bugs I could find when running CDC-ACM. Still some TODO left through the code.
|
c178cfa to
4e6960f
Compare
Add support for Synopsys DWC3 core, with only BULK endpoints supported at the moment, as well as an initial vendor quirks system. Signed-off-by: Josuah Demangeon <me@josuah.net>
|
I finished migrating this to be using IRQs only without a workqueue thread. The tinyCLUNX33 platform still does not have working IRQs, and uses a 1ms timer to simulate this (called from the tinyCLUNX33 vendor quirk, not part of this PR). This means all the event handlers are only tested in non-IRQ context, and some modification might be needed to let all of this run from IRQ, such as reintroducing a work queue if needed. Let me know what error you encounter. |
|



Add support for Synopsys DWC3 core.
There is no hardware implementing this core in this PR, and users are encouraged to include this commit it on downstream PRs, then I will periodically re-integrate the modifications they needed in this PR.
This can help synchronizing the work of everyone on a common basis.
Active branches using this:
Related issues/PRs: